package com.example.zuoye;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class SignActivity extends AppCompatActivity {

    Button submit,back;
    EditText name,psw;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sign);
        back=(Button)findViewById(R.id.back);
        submit=(Button)findViewById(R.id.submit);
        name=(EditText) findViewById(R.id.sign_name);
        psw=(EditText) findViewById(R.id.sign_psw);

        submit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(SignActivity.this,"提交成功",Toast.LENGTH_SHORT).show();
            }
        });

        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent();
                intent.putExtra("name",name.getText().toString());
                intent.putExtra("psw",psw.getText().toString());
                setResult(RESULT_OK,intent);
                //intent.setClass(SignActivity.this,RegistActivity.class);
                finish();
            }
        });
    }
}
